package com.sc.VenusQueryBeta.model.account;

import com.hengjun.kingstar.sdk.base.BaseModel;
import com.hengjun.kingstar.sdk.helper.RetrofitCreateHelper;
import com.hengjun.kingstar.sdk.helper.RxHelper;
import com.sc.VenusQueryBeta.api.Host;
import com.sc.VenusQueryBeta.api.account.AccountApi;
import com.sc.VenusQueryBeta.contract.account.CurrencyContract;
import com.sc.VenusQueryBeta.model.bean.account.CurrencyBean;
import com.sc.VenusQueryBeta.model.bean.account.CurrencyListBean;

import io.reactivex.Observable;

/**
 * Created by Administrator on 2018/11/8.
 * 獲取幣種Model
 */

public class CurrencyModel extends BaseModel implements CurrencyContract.ICurrencyModel {
    /**
     * 实例化对象
     */
    public static CurrencyModel newInstance(){
        return new CurrencyModel();
    }

    @Override
    public Observable<CurrencyBean> getcurrency(String serverAddress, String projectName, int serverPort, int clientindex, int recognitionValue) {
        return RetrofitCreateHelper.createApi(AccountApi.class, Host.base+serverAddress+":"+serverPort+"/"+projectName+"/").getcurrency(clientindex,
                recognitionValue).compose(RxHelper.<CurrencyBean>rxSchedulerHelper());
    }
}
